//
//  BPModifyNameViewController.swift
//  BP_NewClient
//
//  Created by letv on 15/6/19.
//  Copyright (c) 2015年 normal. All rights reserved.
//

import UIKit

class BPModifyNameViewController: BPRootViewController,keyBoardTopBarDelegate {

    @IBOutlet var userName: UITextField?
    @IBOutlet var confirmBtn: UIButton?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationItem.leftBarButtonItem = self.getBackNavigationItem()
        self.navigationItem.title = "修改用户名"
    }

    //MARK UITextFieldDelegate
    func textFieldDidBeginEditing(textField: UITextField){
    
    }
    
    func textFieldShouldReturn(textField: UITextField) -> Bool{
        textField.resignFirstResponder()
        return true
    }
    
    func keyBoardTopBarConfirmClicked(textField: UITextField!) {
        
    }
    //下一项回调
    func keyBoardTopBarNext(textField: UITextField!) {
        
    }
    
    //上一项回调
    func keyBoardTopBarPrevious(textField: UITextField!) {
        
    }

    
   @IBAction func confirmButtonAction(){
        // 修改用户名
        if (userName?.text!.isEmpty == true){
            self.showNoticeMsg("请输入用户名")
            return
        }

<<<<<<< HEAD
        let dic:Dictionary  = ["mobile":"15011036823","username":userName!.text!]
=======
        let dic :Dictionary = ["mobile":"15011036823","username":userName!.text!]
>>>>>>> 288d846b1206e88894e02a6ccf2ace272f888b1f
    
        BPBaseRequest.shareInstance().requestGetWithParamerCallBlock(USER_MODIFY_NAME, parameter: dic, callSuccessBack: {
            (responDictionary: NSDictionary!) in
            NSLog("Hello, this is \(responDictionary)")
                        
            self.showNoticeMsg("修改成功")
            self.navigationController?.popViewControllerAnimated(true)
            }, callFailureBlock: {(responErrorDictionary:NSDictionary!) in
                
        })
    
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
